package admin

type Goods struct {
	Id          int       `json:"id"`
	Name        string    `json:"name" `
	Marks       string    `json:"marks"`
	Brief       string    `json:"brief"`
	Price       float64   `json:"price"`
	Costprice   float64   `json:"costprice"`
	Mktprice    float64   `json:"mktprice"`
	Image       string    `json:"image"`
	Marketable  int       `json:"marketable"`
	Stock       int       `json:"stock"`
	FreezeStock int       `json:"freeze_stock"`
	Unit        string    `json:"unit"`
	Uptime      int       `json:"uptime"`
	Downtime    int       `json:"downtime"`
	GoodsCateId int       `json:"goods_cate_id"`
	GoodsSpecId int       `json:"goods_spec_id"`
	Content     string    `json:"content"`
	Ctime       int       `json:"ctime"`
	Utime       int       `json:"utime"`
	GoodsCate   GoodsCate `gorm:"foreignkey:id;association_foreignkey:goods_cate_id"`
	ImageList   []*Image  `gorm:"many2many:goods_image"`
	//Role     []*Role `gorm:"many2many:admin_role"`
	//GoodsImage  Image     `gorm:"foreignkey:id;association_foreignkey:image_id"`
	//GoodsSpec   GoodsSpec `gorm:"foreignkey:id;association_foreignkey:goods_spec_id"`
	//Checked		bool   `gorm:"-"` // 忽略本字段
}

//定义结构体 对应的数据表
func (Goods) TableName() string {
	return "goods"
}
